package com.jurenzhao.partssystem.system.system_log.entity;

import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

public class System_Log {
    private int logId;

    //0代表一般信息，1代表异常信息
    private String logType;

    public String getLogTypeString() {
        return logType.equals("0")?"一般信息":"异常信息";
    }

    private String logUser;

    private String logIp;

    private String logInfo;

    //0是登录，1是登出，2是添加，3是删除，4是修改
    private String logState;
    public String getLogStateString(){
        int a = Integer.parseInt(logState);
        switch (a){
            case 0 :
                logState = "登录";
                break;
            case 1 :
                logState = "登出";
                break;
            case 2 :
                logState = "添加";
                break;
            case 3 :
                logState = "删除";
                break;
            case 4 :
                logState = "修改";
                break;
                default:
        }
        return logState;
    }

  //  @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date logDate;



    public int getLogId() {
        return logId;
    }

    public void setLogId(int logId) {
        this.logId = logId;
    }

    public String getLogType() {
        return logType;
    }

    public void setLogType(String logType) {
        this.logType = logType == null ? null : logType.trim();
    }

    public String getLogUser() {
        return logUser;
    }

    public void setLogUser(String logUser) {
        this.logUser = logUser == null ? null : logUser.trim();
    }

    public String getLogIp() {
        return logIp;
    }

    public void setLogIp(String logIp) {
        this.logIp = logIp == null ? null : logIp.trim();
    }

    public String getLogInfo() {
        return logInfo;
    }

    public void setLogInfo(String logInfo) {
        this.logInfo = logInfo == null ? null : logInfo.trim();
    }

    public String getLogState() {
        return logState;
    }

    public void setLogState(String logState) {
        this.logState = logState == null ? null : logState.trim();
    }

    public Date getLogDate() {
        return logDate;
    }

    public void setLogDate(Date logDate) {
        this.logDate = logDate;
    }
}